import { Component } from 'react'

interface State {
  count: number
}
class App extends Component<{}, State> {
  state: State = {
    count: 1
  }

  updateCount = () => {
    this.setState({
      count: this.state.count + 1
    })
  }

  render() {
    return (
      <div>
        <h4>根组件</h4>
        <p>{this.state.count}</p>
        <button onClick={this.updateCount}>更改 count</button>
      </div>
    )
  }
}

export default App
